import requests, json,time

headers = {'Content-Type': 'application/json'}


def send_ding(SendText,SendUrl):
    pagrem = {
        "msgtype": "text",
        "text": {
            "content": "demo"+SendText +'  '+str(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
        },
    }
    try:
        f = requests.post(SendUrl, data=json.dumps(pagrem), headers=headers)
    except Exception as e:
        print('网络错误' + e)

if __name__ == "__main__":
    your_email='xxx@xxx'
    send_text='我是一个测试验证程序'+your_email
    send_url='https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
    send_ding(send_text,send_url)
